/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.easoftware.code.mb;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;

/**
 *
 * @author waumovil-javaengineer
 */
@SessionScoped
@Named("mbIndex")
public class MbIndex implements Serializable {

    private Date fechaSys;
    private String contentPage = "body.xhtml";
    @Inject
    MbGenericMaintenance genericMaintenance;

    public String getContentPage() {
        return contentPage;
    }

    public void setContentPage(String contentPage) {
        this.contentPage = contentPage;
    }

    public Date getFechaSys() {
        if (fechaSys != null) {
            fechaSys = Calendar.getInstance().getTime();
        }
        return fechaSys;
    }

    public void setFechaSys(Date fechaSys) {
        this.fechaSys = fechaSys;
    }

    public void logOut() {
    }

    public void loadPage(String page) {
        this.contentPage = page;
    }

    public void loadMaintenance(String maintenance) {
        this.setContentPage("module/generic/maintenance.xhtml");
        genericMaintenance.init(maintenance);
    }
}
